home *** CD-ROM | disk | FTP | other *** search
/ CyberMycha 2008 January / Cybermycha 1_2008.iso / Data.cab / _6FCF6EBD54124B78ACA5F0D30170AFC8 < prev    next >
Encoding:
Text File  |  2004-04-29  |  1.1 KB  |  65 lines

  1.  
  2. regc(2, "COMBINED_XFORM")
  3.  
  4. regc(12, "FOG_PARAMS")
  5.  
  6. regcn(14, "DIRECTIONAL_DIR_MS", 0)
  7.  
  8. regc(20, "TEXTURE2_XFORM")
  9. regc(24, "TEXTURE3_XFORM")
  10.  
  11. // ------------ c40 - c60 reserved
  12. !include("vs_spot_consts.inc")
  13.  
  14. vshader("
  15.  
  16. #define point        v0
  17. #define normal        v1
  18. #define tcoord        v3
  19.  
  20. #define fogp    c12
  21. #define ldir    c14
  22.  
  23.     vs_1_1
  24.  
  25. #include    <cardef.h>
  26. #include    <fog.inc>
  27.  
  28.     def c0, 1, 0, 0, 0
  29.  
  30.     dcl_position    point
  31.     dcl_normal    normal
  32.     dcl_texcoord    tcoord
  33.  
  34.     ; output position
  35.     m4x4    oPos, point, c2
  36.  
  37.     dp3        r4.x, normal, ldir        ; diffuse N*L
  38.  
  39.     ; output diffuse
  40.     mov        oD0.w, r4.x   //  sun
  41. ;------------------------------------------
  42. // spot light
  43. // used r0 - r2
  44. #if VS_SPOTLIGHTS
  45. #include <vs_spot_func.inc>
  46. #endif
  47. ;----------------------------
  48.     ; output texcoords
  49.     mov        oT0, tcoord           // color
  50.     mov     oT1, tcoord        // dirt
  51.  
  52.     ; terrain lightmap texgen (from model space)
  53.     dp4        oT2.x, point, c20
  54.     dp4        oT2.y, point, c21
  55.  
  56.     ; clouds texgen (from model space)
  57.     dp4        oT3.x, point, c24
  58.     dp4        oT3.y, point, c25
  59.  
  60.     ; calc fog
  61.        dp4    r0.x, point, c4
  62.        FOG(r0.x, fogp, r10)
  63. ")
  64.  
  65.